package com.lt.flashcard.view;

import java.util.List;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Path;
import org.zkoss.zk.ui.select.SelectorComposer;

import com.lt.flashcard.model.entity.Flashcard;

public class V_AdminFlashcardListCtrl extends SelectorComposer<Component> {
	
	private static final long serialVersionUID = 1L;
	
    private List<Flashcard> flashcards;
    
    /* (non-Javadoc)
	 * @see org.zkoss.zk.ui.select.SelectorComposer#doBeforeComposeChildren(org.zkoss.zk.ui.Component)
	 */
	@Override
	public void doBeforeComposeChildren(Component comp) throws Exception {
		// TODO Auto-generated method stub
		Component com = Path.getComponent("//admin_flashcardset_details/ctnAdminFlashcardSetDetails");
		AdminFlashcardSetDetailsCtrl ctrl = (AdminFlashcardSetDetailsCtrl) com.getAttribute("$composer");
		flashcards = ctrl.getFlashcards(); 
		super.doBeforeComposeChildren(comp);
	}

	public void setFlashcards(List<Flashcard> flashcards){
    	this.flashcards = flashcards;
    }

    public List<Flashcard> getFlashcards() {
    	return flashcards;
    }
}
